import { useEffect } from 'react';
import { connect } from 'dva';
import { Form, Input, Button, Checkbox, Select } from 'antd';
import { UserOutlined, LockOutlined } from '@ant-design/icons';
import MessageList from '../../components/MessageList';
import SendMessage from '../../components/SendMessage';
import './MessageListPage.css';

const GroupMessagePage = ({ dispatch, messageGroup, username }) => {

  useEffect(() => {
    dispatch({
      type: 'message/getMessageByGroup',
      payload: { messageGroup },
    });
  })

  return (
    <div>
      {
        <MessageList />
      }
    </div>
  );
};

export default connect(state => {
  const { username } = state.users;
  const { messageGroup } = state.message;
  return {
    username,
    messageGroup
  }
})(GroupMessagePage);
